<?php
/**
 * This interface is for engines which can be modified.
 *
 * @author Rob Young <rob@roryoung.co.uk>
 * @package forage.engine
 */
interface ForageEngineModifiable
{
  /**
   * Add a ForageDocument to the index.
   *
   * @param ForageDocument $document
   */
  public function add(ForageDocument $document);

  /**
   * Remove a ForageDocument from the index
   *
   * @param ForageDocument $document
   */
  public function remove(ForageDocument $document);

  /**
   * Flush any changes to the index.
   */
  public function flush();

  /**
   * Optimize the index
   */
  public function optimize();
}
